program SofitSystemClient;

{$R 'login.res' 'login.rc'}
{$R 'workspace.res' 'workspace.rc'}

uses
  uROComInit,
  UnitDllExe in 'UnitDllExe.pas',
  Forms,
  Windows,
  MidasLib,
  fClientForm in 'fClientForm.pas' {ClientForm},
  fClientDataModule in 'fClientDataModule.pas' {ClientDataModule: TDAClientDataModule},
  SofitSystemLibrary_Intf in '..\server\SofitSystemLibrary_Intf.pas',
  fLogin in 'fLogin.pas' {fmLogin},
  fHome in 'fHome.pas' {fmHome},
  tools in 'tools.pas',
  dImages in 'dImages.pas' {dmImages: TDataModule},
  fEmbedTlb in 'fEmbedTlb.pas' {fmEmbedTlb},
  fUserInfo in 'fUserInfo.pas' {fmUserInfo},
  fEmbedTlbLayout in 'fEmbedTlbLayout.pas' {fmEmbedTlbLayout},
  fCustomerInfo in 'fCustomerInfo.pas' {fmCustomerInfo},
  fProductClassView in 'fProductClassView.pas' {fmProductClassView},
  fCustomerInquireInfo in 'fCustomerInquireInfo.pas' {fmCustomerInquireInfo},
  frAttachs in 'frAttachs.pas' {frmAttachs: TFrame},
  frImages in 'frImages.pas' {frmImages: TFrame},
  fLoginConfig in 'fLoginConfig.pas' {fmLoginConfig},
  fFactoryInfo in 'fFactoryInfo.pas' {fmFactoryInfo},
  fBaseBrowser in 'fBaseBrowser.pas' {fmBaseBrowser},
  uPublic in 'uPublic.pas',
  fBaseCode in 'fBaseCode.pas' {fmBaseCode},
  fFactoryInquireInfo in 'fFactoryInquireInfo.pas' {fmFactoryInquireInfo},
  fDataSelect in 'fDataSelect.pas' {fmDataSelect},
  fQuotationInfo in 'fQuotationInfo.pas' {fmQuotationInfo},
  fPiInfo in 'fPiInfo.pas' {fmPiInfo},
  fStockInfo in 'fStockInfo.pas' {fmStockInfo},
  fWarehouseInInfo in 'fWarehouseInInfo.pas' {fmWarehouseInInfo},
  fWarehouseOutInfo in 'fWarehouseOutInfo.pas' {fmWarehouseOutInfo},
  fWarehouseCheckInfo in 'fWarehouseCheckInfo.pas' {fmWarehouseCheckInfo},
  fWarehouseInfo in 'fWarehouseInfo.pas' {fmWarehouseInfo},
  fCompanyInfo in 'fCompanyInfo.pas' {fmCompanyInfo},
  fBankInfo in 'fBankInfo.pas' {fmBankInfo},
  fAccountPayableInfo in 'fAccountPayableInfo.pas' {fmAccountPayableInfo},
  fCheckRequest in 'fCheckRequest.pas' {fmCheckRequest},
  fBtype in 'fBtype.pas' {fmBtype},
  fSelectProductLib in 'fSelectProductLib.pas' {fmSelectProductLib},
  fCheck in 'fCheck.pas' {fmCheck},
  fOtherCompanyInfo in 'fOtherCompanyInfo.pas' {fmOtherCompanyInfo},
  fParam in 'fParam.pas' {fmParam},
  fReports in 'fReports.pas' {fmReports},
  fDepartment in 'fDepartment.pas' {fmDepartment},
  fUserVisible in 'fUserVisible.pas' {fmUserVisible},
  fMessageManage in 'fMessageManage.pas' {fmMessageManage},
  fMessageSender in 'fMessageSender.pas' {fmMessageSender},
  fSelectProductClass in 'fSelectProductClass.pas' {fmSelectProductClass},
  fCalendar in 'fCalendar.pas' {fmCalendar},
  fDownloadApp in 'fDownloadApp.pas' {fmDownloadApp},
  about in 'about.pas' {AboutBox},
  fBulletin in 'fBulletin.pas' {fmBulletin},
  fModelSendConfirm in 'fModelSendConfirm.pas' {fmModelSendConfirm},
  NumberToLetters in 'NumberToLetters.pas',
  fSelectDanZheng in 'fSelectDanZheng.pas' {fmSelectDanZheng},
  fCancelJiaoDan in 'fCancelJiaoDan.pas' {fmCancelJiaoDan},
  fSelectData in 'fSelectData.pas' {fmSelectData},
  fSelectUser in 'fSelectUser.pas' {fmSelectUser},
  fScheduleView in 'fScheduleView.pas' {fmScheduleView},
  fSystemMessageView in 'fSystemMessageView.pas' {fmSystemMessageView},
  fUserMessageView in 'fUserMessageView.pas' {fmUserMessageView},
  fUserList in 'fUserList.pas' {fmUserList},
  fWarehouseAnalyse in 'fWarehouseAnalyse.pas' {fmWarehouseAnalyse},
  fBrowserColumnsConfig in 'fBrowserColumnsConfig.pas' {fmBrowserColumnsConfig},
  fSelectBill in 'fSelectBill.pas' {fmSelectBill},
  fBatchArchive in 'fBatchArchive.pas' {fmBatchArchive},
  fArchive in 'fArchive.pas' {fmArchive},
  fSelectMultiUser in 'fSelectMultiUser.pas' {fmSelectMultiUser},
  fEmployeeInfo in 'fEmployeeInfo.pas' {fmEmployeeInfo},
  fBrowserBase in 'fBrowserBase.pas' {fmBrowserBase},
  fCompany in 'fCompany.pas' {fmCompany},
  fUser in 'fUser.pas' {fmUser},
  fDocManager in 'fDocManager.pas' {fmDocManager},
  fProgress in 'fProgress.pas' {fmProgress},
  fUploadDocument in 'fUploadDocument.pas' {fmUploadDocument},
  fCompanyVisible in 'fCompanyVisible.pas' {fmCompanyVisible},
  fProject in 'fProject.pas' {fmProject},
  fProjectInfo in 'fProjectInfo.pas' {fmProjectInfo},
  fTransport in 'fTransport.pas' {fmTransport},
  fTransportInfo in 'fTransportInfo.pas' {fmTransportInfo},
  fTransportInquire in 'fTransportInquire.pas' {fmTransportInquire},
  fPayRequest in 'fPayRequest.pas' {fmPayRequest},
  fPayRequestInfo in 'fPayRequestInfo.pas' {fmPayRequestInfo},
  fFactoryInquire in 'fFactoryInquire.pas' {fmFactoryInquire},
  fCustomerInquire in 'fCustomerInquire.pas' {fmCustomerInquire},
  fQuotation in 'fQuotation.pas' {fmQuotation},
  fProduct in 'fProduct.pas' {fmProduct},
  fWarehouse in 'fWarehouse.pas' {fmWarehouse},
  fWarehouseIn in 'fWarehouseIn.pas' {fmWarehouseIn},
  fAccountPayable in 'fAccountPayable.pas' {fmAccountPayable},
  fAccountReceivable in 'fAccountReceivable.pas' {fmAccountReceivable},
  fCustomer in 'fCustomer.pas' {fmCustomer},
  fFactory in 'fFactory.pas' {fmFactory},
  fWarehouseOut in 'fWarehouseOut.pas' {fmWarehouseOut},
  fReceiveBalance in 'fReceiveBalance.pas' {fmReceiveBalance},
  fOtherCompany in 'fOtherCompany.pas' {fmOtherCompany},
  fStock in 'fStock.pas' {fmStock},
  fFeeObjectInfo in 'fFeeObjectInfo.pas' {fmFeeObjectInfo},
  fFeeBillNos in 'fFeeBillNos.pas' {fmFeeBillNos},
  fFeeClass in 'fFeeClass.pas' {fmFeeClass},
  fFeeManageInfo in 'fFeeManageInfo.pas' {fmFeeManageInfo},
  fCheckConfigItem in 'fCheckConfigItem.pas' {fmCheckConfigItem},
  fCheckConfig in 'fCheckConfig.pas' {fmCheckConfig},
  fPi in 'fPi.pas' {fmPi},
  fFeeManage in 'fFeeManage.pas' {fmFeeManage},
  fWarehouseCheck in 'fWarehouseCheck.pas' {fmWarehouseCheck},
  fVerification in 'fVerification.pas' {fmVerification},
  fLc in 'fLc.pas' {fmLc},
  fLcInfo in 'fLcInfo.pas' {fmLcInfo},
  fEmployeeAchievement in 'fEmployeeAchievement.pas' {fmEmployeeAchievement},
  fEmployeeRegister in 'fEmployeeRegister.pas' {fmEmployeeRegister},
  fAccountReceivableInfo in 'fAccountReceivableInfo.pas' {fmAccountReceivableInfo},
  fReceiveBalanceInfo in 'fReceiveBalanceInfo.pas' {fmReceiveBalanceInfo},
  fReceiveInvoiceInfo in 'fReceiveInvoiceInfo.pas' {fmReceiveInvoiceInfo},
  fReceiveInvoice in 'fReceiveInvoice.pas' {fmReceiveInvoice},
  fPayBalance in 'fPayBalance.pas' {fmPayBalance},
  fPayBalanceInfo in 'fPayBalanceInfo.pas' {fmPayBalanceInfo},
  fEmployee in 'fEmployee.pas' {fmEmployee},
  fReQuotation in 'fReQuotation.pas' {fmReQuotation},
  fTransportInquireInfo in 'fTransportInquireInfo.pas' {fmTransportInquireInfo},
  fCheckProductReport in 'fCheckProductReport.pas' {fmCheckProductReport},
  fParam2 in 'fParam2.pas' {fmParam2},
  fNewFolder in 'fNewFolder.pas' {fmNewFolder},
  fRename in 'fRename.pas' {fmRename},
  fDownloadDocument in 'fDownloadDocument.pas' {fmDownloadDocument},
  fManager in 'fManager.pas' {fmManager},
  fEmployeeRegisterInfo in 'fEmployeeRegisterInfo.pas' {fmEmployeeRegisterInfo},
  fEmployeeLocation in 'fEmployeeLocation.pas' {fmEmployeeLocation},
  fHomeWork in 'fHomeWork.pas' {fmHomeWork},
  fFeeObject in 'fFeeObject.pas' {fmFeeObject},
  fOutBusiness in 'fOutBusiness.pas' {fmOutBusiness},
  fOutBusinessInfo in 'fOutBusinessInfo.pas' {fmOutBusinessInfo},
  fLRAnalyse in 'fLRAnalyse.pas' {fmLRAnalyse},
  fFeeAnalyse in 'fFeeAnalyse.pas' {fmFeeAnalyse},
  fInput in 'fInput.pas' {fmInput},
  fLabelConfig in 'fLabelConfig.pas' {fmLabelConfig},
  fImportConfig in 'fImportConfig.pas' {fmImportConfig},
  fCheckManager in 'fCheckManager.pas' {fmCheckManager},
  fProjectLabelConfig in 'fProjectLabelConfig.pas' {fmProjectlabelConfig},
  fRecycle in 'fRecycle.pas' {fmRecycle},
  fHint2 in 'fHint2.pas' {fmHint2},
  fChangePassword in 'fChangePassword.pas' {fmChangePassword},
  uRelatedTools in 'uRelatedTools.pas',
  fBaseView in 'fBaseView.pas' {fmBaseView},
  fPiView in 'fPiView.pas' {fmPiView},
  fStockView in 'fStockView.pas' {fmStockView},
  fManagerView in 'fManagerView.pas' {fmManagerView},
  fProjectView in 'fProjectView.pas' {fmProjectView},
  fReceivableView in 'fReceivableView.pas' {fmReceivableView},
  fPayableView in 'fPayableView.pas' {fmPayableView},
  fFactoryInquireView in 'fFactoryInquireView.pas' {fmFactoryInquireView},
  fQuotationView in 'fQuotationView.pas' {fmQuotationView},
  fTransportManage in 'fTransportManage.pas' {fmTransportManage},
  fTransportManageInfo in 'fTransportManageInfo.pas' {fmTransportManageInfo},
  fBillManager in 'fBillManager.pas' {fmBillManager},
  fCustomerFollow in 'fCustomerFollow.pas' {fmCustomerFollow},
  fTrace in 'fTrace.pas' {fmTrace},
  fRemind in 'fRemind.pas' {fmRemind},
  fManageProblem in 'fManageProblem.pas' {fmManageProblem},
  fWarehouseTransfer in 'fWarehouseTransfer.pas' {fmWarehouseTransfer},
  fWarehouseTransferInfo in 'fWarehouseTransferInfo.pas' {fmWarehouseTransferInfo},
  fWarehouseBorrow in 'fWarehouseBorrow.pas' {fmWarehouseBorrow},
  fWarehouseReturn in 'fWarehouseReturn.pas' {fmWarehouseReturn},
  fWarehouseBorrowInfo in 'fWarehouseBorrowInfo.pas' {fmWarehouseBorrowInfo},
  fWarehouseReturnInfo in 'fWarehouseReturnInfo.pas' {fmWarehouseReturnInfo},
  fPendingProject in 'fPendingProject.pas' {fmPendingProject},
  fPendingProjectInfo in 'fPendingProjectInfo.pas' {fmPendingProjectInfo},
  fProblem in 'fProblem.pas' {fmProblem},
  fProblemInfo in 'fProblemInfo.pas' {fmProblemInfo},
  fWarehouseReceive in 'fWarehouseReceive.pas' {fmWarehouseReceive},
  fWarehouseReceiveInfo in 'fWarehouseReceiveInfo.pas' {fmWarehouseReceiveInfo},
  fWarehouseRejection in 'fWarehouseRejection.pas' {fmWarehouseRejection},
  fWarehouseRejectionInfo in 'fWarehouseRejectionInfo.pas' {fmWarehouseRejectionInfo},
  fBillAnalyse in 'fBillAnalyse.pas' {fmBillAnalyse},
  fBaseAnalyse in 'fBaseAnalyse.pas' {fmBaseAnalyse},
  fWarehouseinAnalyse in 'fWarehouseinAnalyse.pas' {fmWarehouseinAnalyse},
  fWarehouseoutAnalyse in 'fWarehouseoutAnalyse.pas' {fmWarehouseoutAnalyse},
  fWorkSpace in 'fWorkSpace.pas' {fmWorkSpace},
  uNavigatePanel in 'uNavigatePanel.pas',
  frNavigatePage in 'frNavigatePage.pas' {frmNavigatePage: TFrame},
  frTileControlPage in 'frTileControlPage.pas' {frmTileControlPage: TFrame},
  frGeneralPage in 'frGeneralPage.pas' {frmGeneralPage: TFrame},
  frMainTileControlPage in 'frMainTileControlPage.pas' {frmMainTileControlPage: TFrame},
  frBillPage in 'frBillPage.pas' {frmBillPage: TFrame},
  frProjectPage in 'frProjectPage.pas' {frmProjectPage: TFrame},
  frBuyRequestPage in 'frBuyRequestPage.pas' {frmBuyRequestPage: TFrame},
  frUserTileControlPage in 'frUserTileControlPage.pas' {frmUserTileControlPage: TFrame},
  frEmployeePage in 'frEmployeePage.pas' {frmEmployeePage: TFrame},
  fBuyRequest in 'fBuyRequest.pas' {fmBuyRequest},
  fBuyRequestInfo in 'fBuyRequestInfo.pas' {fmBuyRequestInfo},
  fTravelBook in 'fTravelBook.pas' {fmTravelBook},
  fTravelBookInfo in 'fTravelBookInfo.pas' {fmTravelBookInfo},
  fCarRequest in 'fCarRequest.pas' {fmCarRequest},
  fCarList in 'fCarList.pas' {fmCarList},
  fCarRequestInfo in 'fCarRequestInfo.pas' {fmCarRequestInfo},
  fCarListInfo in 'fCarListInfo.pas' {fmCarListInfo},
  frTracePage in 'frTracePage.pas' {frmTracePage: TFrame},
  frCalendarPage in 'frCalendarPage.pas' {frmCalendarPage: TFrame},
  fBillTrace in 'fBillTrace.pas' {fmBillTrace},
  frDepartmentPage in 'frDepartmentPage.pas' {frmDepartmentPage: TFrame},
  fProjectPage in 'fProjectPage.pas' {fmProjectPage},
  frCompanyDocPage in 'frCompanyDocPage.pas' {frmCompanyDocPage: TFrame},
  frCompanyNoticePage in 'frCompanyNoticePage.pas' {frmCompanyNoticePage: TFrame},
  frCarRequestPage in 'frCarRequestPage.pas' {frmCarRequestPage: TFrame},
  fTravelBoolDealInfo in 'fTravelBoolDealInfo.pas' {fmTravelBookDealInfo},
  frMyTaskPage in 'frMyTaskPage.pas' {frmMyTaskPage: TFrame},
  frManagerPage in 'frManagerPage.pas' {frmManagerPage: TFrame};

{$R *.res}

var Mutex: THandle;

procedure CheckPrevInst;
begin
  Mutex := OpenMutex(MUTEX_ALL_ACCESS, False, 'single_instance_SofitSystemClient_program_mutex');
  if Mutex = 0 then begin //mutex doesn't exists
    Mutex := CreateMutex(nil, False, 'single_instance_SofitSystemClient_program_mutex');
  end
  else begin
    CloseHandle(Mutex);
    Halt;
  end;
end;


begin
//  ReportMemoryLeaksOnShutdown := DebugHook <> 0;
  Application.Initialize;
//  SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle,
//    GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
//  Application.Title := '';
//  CheckPrevInst;

  Application.CreateForm(TClientDataModule, ClientDataModule);
  Application.CreateForm(TdmImages, dmImages);  
  Application.CreateForm(TClientForm, ClientForm);  
  if not UserLogin then
  begin
    ExitProcess(0);
  end;


  Application.CreateForm(TfmMessageManage, fmMessageManage);
  Application.CreateForm(TfmHint2, fmHint2);
  
//  Application.CreateForm(TClientForm, ClientForm);
//  ClientForm.itemHomeClick(ClientForm.itemHome as TObject);

  ClientForm.Show;
  ClientForm.itemHome.Click;  
//  fmHome.Show;


  Application.Run;
//  ReleaseMutex(Mutex);
//  CloseHandle(Mutex);
//  dmImages.Free;
//  ClientDataModule.Free;
end.
